import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
     {
      path: '/',
      name: 'login',
      hideInMenu: false,
      component: () => import('../views/Login.vue'),
    },
    {
      path:'/admin',
      name:'admin',
      component: () => import('../views/Mainpage/admin.vue'),
      redirect:'/admin/home',
      
      children:[
        {
          path:'/admin/home',
          name:'adminHome',
          component:()=>import('../views/Mainpage/admin/adminherd.vue')

        },
        {
          path:'/admin/author',
          name:'adminAuthor',
          component:()=>import('../views/Mainpage/admin/author.vue')
        },{
          path:'/admin/reader',
          name:'adminReader',
          component:()=>import('../views/Mainpage/admin/reader.vue')
        },
        {
          path:'/admin/classify',
          name:'adminClassify',
          component:()=>import('../views/Mainpage/admin/classify.vue')
         },{
          path:'/admin/authorbook',
          name:'adminAuthorBook',
          component:()=>import('../views/Mainpage/admin/authorbook.vue')
         },{
          path:'/admin/press',
          name:'adminPress',
          component:()=>import('../views/Mainpage/admin/press.vue')
         },{
          path:'/admin/tag',
          name:'adminTag',
          component:()=>import('../views/Mainpage/admin/tag.vue')
         }
      ]
    
    },
    {
      path:'/user',
      name:'user',
      component: () => import('../views/Mainpage/user.vue'),
    },
    {
      path:'/writer',
      name:'writer',
      component: () => import('../views/Mainpage/writer.vue'),
      redirect:'/writer/individual',
      children:[
          {
            path:'/writer/individual',
            name:'individual',
            component:()=>import('../views/Mainpage/writer/individual.vue')
          },
          {
            path:'/writer/booktype',
            name:'booktype',
            component:()=>import('../views/Mainpage/writer/booktype.vue')
          },
          {
            path:'/writer/bookpart',
            name:'bookpart',
            component:()=>import('../views/Mainpage/writer/bookpart.vue')
          }

      ]
    },
    {
      path:'/register',
      name:'register',
      component: () => import('../views/Mainpage/register.vue'),
    },
    {
      path:'/retriever',
      name:'retriever',
      component: () => import('../views/Mainpage/retriever.vue'),
    }

  ],
})

export default router

